package com.joven.core.controller;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.joven.core.model.User;
import com.joven.core.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author joven_wong
 * 2021/10/9 16:28
 */
@RestController
@RequestMapping("/map/joven")
@RequiredArgsConstructor
public class TestMappingController {

    private final UserService userService;

    @PutMapping
    public String updateMapper(){
        userService.update(new UpdateWrapper<User>().lambda().set(User::getAge,"28").eq(User::getName,"joven"));
        return "SUCCESS";
    }
}
